﻿/*********************************************************************
 *
 *                             NOTICE
 *               COPYRIGHT (c) 2012 Panoscopix Software, Inc.
 *                UNPUBLISHED - ALL RIGHTS RESERVED
 * 
 *      This program is confidential, proprietary, and a trade
 *   secret of Panoscopix Software, Inc. The receipt or possession of
 *     this program does not convey any rights to reproduce or
 *      disclose its contents, or to manufacture, use, or sell
 *       anything that it may describe, in whole or in part, 
 *   without the specific written consent of Panoscopix Software, Inc.
 *
 * Command class for "touching" a file, i.e., creating a file.
 * 
 *******************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using FileSystem;

namespace FileSystem.Impl.Actions
{
    public class Help :  ActionABC, IAction
    {
        private IAcionHelpStrategy actionHelpStrategy;
        private ICommandHelpStrategy commandHelpStrategy;

      

        public Help()
            : base(new HelpDescription() { Name = "help", Description = "Provides help" })
        {
			//for zombie
            this.actionHelpStrategy = new SimpleHelpStrategy();
            this.commandHelpStrategy = new SimpleHelpStrategy();
		}

   
        #region IAction Members

        public override IResult execute()
        {
            StringBuilder outx = new StringBuilder();

            outx.AppendLine("Following actions are available-");
            AppResources.getInstance().getActionFactory().describeAction(actionHelpStrategy);
            outx.AppendLine(actionHelpStrategy.HelpText);

            outx.AppendLine("Following commands are available-");
            AppResources.getInstance().getCommandRegistry().describeCommand(commandHelpStrategy);
            outx.AppendLine(commandHelpStrategy.HelpText);

            return new Result(outx.ToString());
        }

        #endregion

      
    }
}
